home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.5 Applications 1999 May / SGI IRIX 6.5 Applications 1999 May.iso / dist / cosmocreate.idb / usr / share / CosmoCreate / buttons / README.z / README
Text File  |  1998-05-07  |  5KB  |  135 lines

  1.  
  2. How to Construct a Button File
  3. ------------------------------
  4.  
  5. 1. What is it?
  6.  
  7.     The button file is basically a special purpose Inventor
  8.     file, as indicated by its .jbm extention. 
  9.  
  10.     Among other things, it contains the color, textures, 
  11.     lights, and geometry that compose the button scene. 
  12.  
  13.     In addition, it contains two very special nodes,
  14.     the CoTextGraph node, and the CoMultiButton node. 
  15.     Together these nodes form the dynamic resizing button
  16.     structure, which means the file will reconfigure itself
  17.     to surround the text when loaded into a capable 
  18.     editor/viewer/renderer.
  19.     
  20.     Unfortunately, since the file is not pure Inventor, it can't
  21.     be viewed in any of the standard viewers (ivview, SceneViewer, etc.)
  22.     Instead, it must be viewed in Button Magic. 
  23.     
  24.     Below are some hints on how to create, test, and debug a button.
  25.  
  26.  
  27. 2. How do you create one?
  28.     
  29.  
  30.     Step 1. Model the geometry.
  31.        This involves using a tool to construct several
  32.        different sizes of a particular geometry, one for 
  33.        each of several (12 or so) aspect ratios. 
  34.        
  35.        This can be done in any tool that can read (or at least write)
  36.        Inventor format.  You can use Showcase to create a button like
  37.        Quad.jbm, for example, using the bevel tools.
  38.        CosmoWorlds may be used to create something like the arrow
  39.        buttons (LeftArrow.jbm and RightArrow.jbm), although you will 
  40.        have to translate the VRML file back to Inventor 
  41.        format before it can be used. It's also possible to create
  42.        a simple button with vi or your favorite text editor. 
  43.        See the comments in the file ExampleButton for details.
  44.  
  45.        You should build all button geometry centered at 
  46.        the origin so that lighting will be consistent as the 
  47.        button changes.
  48.  
  49.     Step 2. Collect the geometry under a switch node.
  50.        The geometry must be sorted under a single Switch
  51.        node. If the geometry is more complex than a simple
  52.        primitive, group all geometry for a given button under
  53.        a Separator under this Switch.
  54.  
  55.        The geometry should be sorted in order of increasing
  56.        aspect (width / height).
  57.  
  58.     Step 3. Test it using a program such as gview.
  59.        The gview program (usr/demos/Inventor/gview) which 
  60.        comes out of inventor_eoe.demo.progs is very useful 
  61.        for doing this, since it allows fields of the nodes
  62.        to be changed.
  63.  
  64.        Open the top level SoSwitch node and step the 
  65.        whichChild field from 0 to the number of child
  66.        geometry nodes - 1.
  67.  
  68.        As you do this, the geometry should expand horizontally
  69.        with each new value of whichChild. 
  70.  
  71.     Step 4. Once you're satisfied with the behavior, take a look at
  72.        the ExampleButton file. You will be replacing the Switch
  73.        node (and its children) in the ExampleButton file with the 
  74.        toplevel Switch node (and its children) in the file you 
  75.        just created.
  76.  
  77.     Step 5. Once you're happy with the file, run Button Magic on it.
  78.        You can load the button directly by running:
  79.  
  80.        /usr/lib/CosmoCreate/apps/buttonMagic -f myfile.jbm
  81.  
  82.     Step 6. For ButtonMagic to see the file, it must end in .jbm
  83.        (as in Just a Button Magic file)
  84.  
  85.  
  86. 3. Hints on creating geometry.
  87.  
  88.     A. Create all buttons with the center at the origin.
  89.  
  90.     B. Creating geometry that grows slowly at first is a good start.
  91.        Here's a good set of aspects to construct
  92.  
  93.        1 2 3 4 5 6 7 8 10 12 18 24 32 48 64 96
  94.  
  95.        More is better, but this allows for a good range of sizes
  96.        and aspects.
  97.  
  98.        After deciding the appropriate aspect of the button,
  99.        Button Magic "blends" between buttons by performing
  100.        a non-uniform scale on the chosen button. This can result
  101.        in undesirable artifacts (non-uniform bevels, for example).
  102.        As a result, you should focus your efforts on creating buttons
  103.        in the region of aspects that you use the most.
  104.        Typically, these will be 10 to 20 characters on
  105.        a button with aspects between 1:1 and 10:1.
  106.  
  107.     C. Remove all material properties below the switch node.
  108.        This is required so that Button Magic can assign materials.
  109.        An exception to this rule is if you wish to create a button
  110.        with some kind of constant color trim (black trim, for example).
  111.        In general, it should be avoided.
  112.  
  113.     D. Add an SoComplexity node at the top of the scene graph or as
  114.        the node just before the above Switch node. Setting 
  115.        the value to 1.0 will result in the best looking buttons,
  116.        but will increase rendering time. (See Aluminum.jbm as an example)
  117.  
  118.     E. To better show when Button Magic switches geometry,
  119.        temporary materials may be added to each of the children
  120.        under the switch node. (See ExampleButton)
  121.  
  122.     
  123. 4. Hints on lighting
  124.     
  125.     A. Try not to use too many colored lights. This will limit
  126.        the range of materials that will look good on the button.
  127.  
  128.     B. Point lights add visual complexity, but slow down rendering
  129.        time.
  130.  
  131.     C. Make sure all lights appear in the LightGroup.
  132.  
  133.  
  134.  
  135.